import { post } from '@/utils/ajax'

// 分页查询序列管理信息
export function getSequenceList(query) {
  return post('/uni/sequence/getSequenceList', query)
}

// 查询所有序列管理信息
export function searchAll() {
  return post('/uni/sequence/searchAll')
}

// 新增序列管理信息
export function insertSequenceInfo(query) {
  return post('/uni/sequence/insertSequenceInfo', query)
}

// 迁移保存
export function saveSequenceFromRedis() {
  return post('/uni/sequence/saveSequenceFromRedis')
}

// 迁移恢复
export function recoverSequenceToRedis() {
  return post('/uni/sequence/recoverSequenceToRedis')
}

// 单条迁移保存
export function saveSingleSequenceFromRedis(sequenceCode) {
  return post('/uni/sequence/saveSingleSequenceFromRedis', { sequenceCode })
}

// 单条迁移恢复
export function recoverSingleSequenceToRedis(sequenceCode) {
  return post('/uni/sequence/recoverSingleSequenceToRedis', { sequenceCode })
}

// 获取单个序列管理信息
export function getSequenceInfo(sequenceCode) {
  return post('/uni/sequence/getSequenceInfo', { sequenceCode })
}

// 更新单个序列管理信息
export function updateSequenceInfo(query) {
  return post('/uni/sequence/updateSequenceInfo', query)
}

// 更新序列管理信息和字段信息
export function updateSequenceAndFieldInfo(query) {
  return post('/uni/sequence/updateSequenceAndFieldInfo', query)
}

// 删除序列管理信息
export function deleteBySequenceCode(sequenceCode) {
  return post('/uni/sequence/deleteBySequenceCode', { sequenceCode })
}

// 生成序列号
export function nextValue(query) {
  return post('/uni/sequence/nextValue', query)
}

// 获取自定义参数列表
export function getCustomParams(sequenceCode) {
  return post('/uni/sequence/getCustomParams', { sequenceCode })
}
